<?php
namespace app\wxapp\controller;

use app\common\entity\Result;
use app\common\service\OrderService;
use app\Request;

class Order extends Base {


    /**
     * 判断用户是否已经买过
     * @param Request $request
     * @return \think\Response
     */
    public function order(Request $request){
        $srcId = $request->param('srcId');
        $type = $request->param("type");
        if(empty($srcId) || empty($type)){
            return Result::error("缺少参数");
        }

        $service = new OrderService();
        $result = $service->order($this->user['id'],$srcId,$type);
        return Result::success($result);

    }

}